﻿/*
// Exepack.NET 
// http://www.codeplex.com/exepack
//
// Compression progress event args
// Written by Y [21-02-10]
// Copyright (c) 2008-2010 Alexey Yakovlev
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Exepack
{
	/// <summary>
	/// Assembly compression progress
	/// </summary>
	public class CompressionProgressEventArgs : EventArgs
	{
		/// <summary>
		/// Name of the file being compressed
		/// </summary>
		public string FileName { get; private set; }

		/// <summary>
		/// Uncompressed file size
		/// </summary>
		public int OriginalSize { get; private set; }

		/// <summary>
		/// Compressed file size (it's unknown when compression is just began)
		/// </summary>
		public int? CompressedSize { get; private set; }

		/// <summary>
		/// Returns true if the current file is packed
		/// </summary>
		public bool Completed { get; private set; }

		/// <summary>
		/// Overall progress, in percents
		/// </summary>
		public int OverallProgress { get; private set; }

		/// <summary>
		/// Initializes CompressionProgressEventArgs when file compression is started
		/// </summary>
		public CompressionProgressEventArgs(string file, int size, int progress)
		{
			FileName = file;
			OriginalSize = size;
			CompressedSize = null;
			Completed = false;
			OverallProgress = progress;
		}

		/// <summary>
		/// Initializes CompressionProgressEventArgs when file compression is finished
		/// </summary>
		public CompressionProgressEventArgs(string file, int size, int packed, int progress)
		{
			FileName = file;
			OriginalSize = size;
			CompressedSize = packed;
			Completed = true;
			OverallProgress = progress;
		}
	}
}
